#!/bin/bash

function install() {
  if [ ! -d ${HOME}/.my-shell-tools ]; then
    git clone https://gitee.com/draba/my-shell-tools.git ${HOME}/.my-shell-tools
  fi
  for file in "${HOME}/.zshrc" "${HOME}/.bashrc";
  do
    if [ -f "${file}" ]; then
      echo -e "\nexport MY_SHELL_TOOLS=${HOME}/.my-shell-tools/bin\nexport PATH=\$MY_SHELL_TOOLS:\$PATH\n" >> $file
    fi
  done
}

if [ -z "${MY_SHELL_TOOLS}" ];then
  echo "install my-shell-tools"
  install
  echo "install my-shell-tools ok"
fi

